<?php 
/**
 * Concept: Archive content setup
 * Copyright 2011 www.gradientpixels.ca
 * Theme: Incantation
 */

get_header(); ?>

<?php			
	$bloglayout = of_get_option('blog_layout');
		switch ($bloglayout) {
		case "left": // with left sidebar ?>
			
<div id="content-wrapper" class="clearfix" >
	<div class="w960 padding55">		
		<?php get_template_part( 'inc/sidebar-blog-left'); ?>			
		<div id="content-right" role="main">
			<section id="primary">
				<?php if ( have_posts() ) : ?>
					<header class="page-header">
						<h1 class="page-title">
							<?php if ( is_day() ) : ?>
								<?php printf( __( 'Daily Articles for %s', 'gp' ), '<span>' . get_the_date() . '</span>' ); ?>
							<?php elseif ( is_month() ) : ?>
								<?php printf( __( 'Monthly Articles for %s', 'gp' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
							<?php elseif ( is_year() ) : ?>
								<?php printf( __( 'Yearly Articles for %s', 'gp' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
							<?php else : ?>
								<?php _e( 'Blog Archives', 'gp' ); ?>
							<?php endif; ?>
						</h1>
					</header>
					<?php while ( have_posts() ) : the_post(); ?>
						<?php get_template_part( 'content', 'blog'); ?>
					<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

					<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>
			</section>			
		</div><!-- #content-right -->				
	</div><!-- .w960 -->
</div><!-- #content-wrapper -->	
			
			<?php 
			break;
		case "full": // full width ?>

<div id="content-wrapper" class="clearfix" >
		<div class="w960 padding55">
			<div id="content-main" role="main">
			<section id="primary">
				<?php if ( have_posts() ) : ?>
					<header class="page-header">
						<h1 class="page-title">
							<?php if ( is_day() ) : ?>
								<?php printf( __( 'Daily Articles for %s', 'gp' ), '<span>' . get_the_date() . '</span>' ); ?>
							<?php elseif ( is_month() ) : ?>
								<?php printf( __( 'Monthly Articles for %s', 'gp' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
							<?php elseif ( is_year() ) : ?>
								<?php printf( __( 'Yearly Articles for %s', 'gp' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
							<?php else : ?>
								<?php _e( 'Blog Archives', 'gp' ); ?>
							<?php endif; ?>
						</h1>
					</header>
					<?php while ( have_posts() ) : the_post(); ?>
						<?php get_template_part( 'content', 'blog'); ?>
					<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

					<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>
			</section>			
			</div><!-- #content-main -->				
		</div><!-- .w960 -->
</div><!-- #content-wrapper -->

			<?php 
			break;
		case "right": // with right sidebar ?>

<div id="content-wrapper" class="clearfix" >
	<div class="w960 padding55">
		<div id="content-left" role="main">
			<section id="primary">
				<?php if ( have_posts() ) : ?>
					<header class="page-header">
						<h1 class="page-title">
							<?php if ( is_day() ) : ?>
								<?php printf( __( 'Daily Articles for %s', 'gp' ), '<span>' . get_the_date() . '</span>' ); ?>
							<?php elseif ( is_month() ) : ?>
								<?php printf( __( 'Monthly Articles for %s', 'gp' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); ?>
							<?php elseif ( is_year() ) : ?>
								<?php printf( __( 'Yearly Articles for %s', 'gp' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); ?>
							<?php else : ?>
								<?php _e( 'Blog Archives', 'gp' ); ?>
							<?php endif; ?>
						</h1>
					</header>
					<?php while ( have_posts() ) : the_post(); ?>
						<?php get_template_part( 'content', 'blog'); ?>
					<?php endwhile; ?>
				
<?php if(function_exists('wp_pagenavi')) { // if PageNavi is activated ?>
	<?php wp_pagenavi(); // Use PageNavi ?>
<?php } else { // Otherwise, use traditional Navigation ?>
	<?php gp_content_nav( 'nav-below' ); ?> 
<?php } // End if-else statement ?>

					<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'gp' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'gp' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>
			</section>
		</div><!-- #content-left -->			
		<?php get_template_part( 'inc/sidebar-blog-right'); ?>				
	</div><!-- .w960 -->
</div><!-- #content-wrapper -->

			<?php
			break;
		}			
?>	

<?php get_footer(); ?>